﻿$(function () {

    //提交表单确认
    $("input[type='submit'].subForward").click(function () {
        if (confirm("您确定要提交该IT服务申请?")) {
            return true;
        } else {
            return false;
        }
    });
    //保存表单确认
    $("input[type='submit'].subSave").click(function () {
        if (confirm("您确定要保存该IT服务申请?")) {
            return true;
        }
        else {
            return false;
        }
    });
    //取消表单确认
    $("input[type='button'].btnCancel").click(function () {
        if (confirm("您确定要取消并关闭该IT服务申请?")) {
            window.location = "/ITService/Index";
        }
    });
    //Select联动 appCategory
    $("select#appCategory").change(function () {
        $.ajax({
            url: "getAppSystem",
            type: "GET",
            data: { "category": $("select#appCategory option:selected").val(), "company": $("input#account_company").val() },
            success: function (data) {
                $("select#appName").empty();
                $.each(data, function (i, item) {
                    $("select#appName").append("<option value='" + item.Name + "'>" + item.Name + "</option>");
                });
                $('select#appName').unbind('click', defaultClickEvent);
            }
        });

    });
})
function AddGreybackgroundDiv() {
    var docheight = $(document).height();
    //追加一个层，使背景变灰
    if ($("#greybackground").length == 1) {
        $("#greybackground").css({ "opacity": "0.5", "height": docheight });
        $("#greybackground").show();
    }
};